package org.codert.codertadmin.web.controller;

import org.codert.codertadmin.config.extend.ObjectProviderTestConfiguration;
import org.springframework.beans.factory.ObjectProvider;
import org.springframework.stereotype.Component;

import java.lang.annotation.*;

/**
 * @author: TanJingyu
 * @create: 2021-08-17 15:28
 **/
@Component
public class TestController {

    public TestController(ObjectProvider<ObjectProviderTestConfiguration.Father> fathers) {
        Object object = fathers.getObject();
        System.out.println("");
    }

    public static void main(String[] args) throws NoSuchMethodException {

    }

    @Component
    public static class Demo extends DemoFather{
        public static void main(String[] args) {
            Class<Demo> demoClass = Demo.class;
            System.out.println(demoClass.getAnnotations().length);
            System.out.println(demoClass.getDeclaredAnnotations().length);
        }
    }

    @DemoAnn
    public static class DemoFather {}

    @Target(ElementType.TYPE)
    @Retention(RetentionPolicy.RUNTIME)
    @Documented
//    @Inherited
    public @interface DemoAnn {}

//    @Target(ElementType.TYPE)
//    @Retention(RetentionPolicy.RUNTIME)
//    @Documented
//    @Inherited
//    @DemoAnn
//    public static @interface DemoAnnss {}
}
